import fileIconMap from '@/assets/ts/FileIconMap'

const getFileIcon = (filePath: string) => {
  let fileNameSplit = filePath.split('.')
  let suffix = fileNameSplit[fileNameSplit.length - 1]

  if (fileNameSplit.length === 1) suffix = 'plain'

  return fileIconMap.get(suffix) || fileIconMap.get('plain')
}

export { getFileIcon }
